<?php
require_once "../../resources/inc/dbconnect.php";
?>
<table style="vertical-align:text-top;">
<tr>
<td>
<?php
$word = $_GET['q1'];
$line = $_GET['q2'];
$sql = "SELECT a.api_name, d.doc_file FROM apis as a, docs as d WHERE a.id=d.api_id";
$resultAPIs = @mysql_query($sql);
if(!$resultAPIs){
	DIE ('Failed to load API list');
}
while($result = mysql_fetch_array($resultAPIs)){
	if(!(stripos($result['api_name'], $word)===false) || !(stripos($line, $result['api_name'])=== false)){
		print "<b><u>".$result['api_name']."()</u></b>";
		print '<br />';
		//$file=fopen("../../files/help/".$result['doc_file'],"r") or exit("Unable to open file!");
		//while (!feof($file)) {
		//  echo fgets($file). "<br />";
		//}
		//fclose($file);
		print highlight_file("../../files/help/".$result['doc_file'],true);
		print '<br />';
		print '<br />';
	}
	
}
?>
</td>
</tr>
</table>
